package com.bolang.onlycode.demo.designPatterns.Strategy;

import java.math.BigDecimal;
import java.util.ListIterator;

/**
 * @Auther: bl_xueld
 * @Date: 2021/11/25 09:52
 * @Description:
 */
public class BookStore {
    public static void main(String[] args) {
        //选择并创建需要使用的策略对象
        Member advancedMember = new AdvancedMember();
        // 创建环境
        Cashier cashier = new Cashier(advancedMember);
        // 计算价格
        BigDecimal calculate = cashier.calculate(new BigDecimal("105"));
        System.out.println("高级图书会员的最终价格为"+calculate);
        Member intermediateMember = new IntermediateMember();
        Cashier cashier1 = new Cashier(intermediateMember);
        BigDecimal calculate1 = cashier1.calculate(new BigDecimal("105"));
        System.out.println("中级图书会员的最终价格为"+calculate1);

    }

}
